local skynet = require "skynet"
local msghelper = require "ranklistsvrhelper"
local base = require "base"
local serverbase = require "serverbase"
local table = table
require "enum"
require "skynet.manager"

local params = ...


local RankListsvrd = serverbase:new(
	{
		continue_update_days = 1,
		wending_rank_copy_tag = 0,
	}
)


function RankListsvrd:tostring()
	return "RankListsvrd"
end

local function ranklistsvrd_to_sring()
	return RankListsvrd:tostring()
end

function  RankListsvrd:init()
	msghelper:init(RankListsvrd)
	self.eventmng.init(RankListsvrd)
	self.eventmng.add_eventbyname("cmd", "ranklistsvrcmd")
	self.eventmng.add_eventbyname("notice", "ranklistsvrnotice")
	self.eventmng.add_eventbyname("request", "ranklistsvrrequest")
	self.eventmng.add_eventbyname("timer", "ranklisttimer")
	RankListsvrd.__tostring = ranklistsvrd_to_sring
end 

skynet.start(function()  
	if params == nil then
		RankListsvrd:start()
	else		
		RankListsvrd:start(table.unpack(base.strsplit(params, ",")))
	end	
end)
